//
//  netVideoViewController.m
//  MJVideoPlayer
//
//  Created by 梅杰 on 16/8/17.
//  Copyright © 2016年 梅杰. All rights reserved.
//

#import "netVideoViewController.h"
#import "MBProgressHUD+BWMExtension.h"
#import "MRVLCPlayer.h"
#import <MobileVLCKit/MobileVLCKit.h>
@interface netVideoViewController ()
@property (weak, nonatomic) IBOutlet UITextView *urlTefd;
@property (weak, nonatomic) IBOutlet UIButton *play;
- (IBAction) playBtnClicked : (UIButton *)sender;
@end

@implementation netVideoViewController

- (IBAction) playBtnClicked : (UIButton *)sender{
    
    if(self.urlTefd.text.length <= 0){
        [MBProgressHUD bwm_showTitle:@"网络路径不能为空" toView:self.view hideAfter:2.0];
        return;
    }
    
    
    MRVLCPlayer *player = [[MRVLCPlayer alloc] init];
    NSURL *mediaUrl = [NSURL URLWithString:self.urlTefd.text];
    player.mediaURL = mediaUrl;
    player.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width * 9 / 16);
    [player showInView:self.view.window];
    player.center = player.superview.center;
}

@end
